package com.fc.advbox.dto.admin;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.CreditCardNumber;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Description:
 * User: Charles.Gao
 * Date: 2018-07-11 17:16
 */
@Getter
@Setter
@ApiModel(value = "InvestorAssetReqDto", description = "投资人资产对象")
public class InvestorAssetReqDto {

    @ApiModelProperty(value = "userId")
    @NotNull(message="用户ID不能为空")
    private Long userId;

    @ApiModelProperty(value = "assetName")
    @NotBlank(message="资产名称不能为空")
    private String assetName;

    @ApiModelProperty(value = "amount")
    @NotNull(message="金额不能为空")
    @Max(value=1000000, message="金额不能超过100万")
    @Min(value=100, message="金额不能小于100元")
    private BigDecimal amount;

    @ApiModelProperty(value = "interestPerYear")
    @NotNull(message="年化收益不能为空")
    @Digits(integer = 0, fraction =3, message="年化收益超出了允许范围(只允许在0位整数和3位小数范围内)" )
    private BigDecimal interestPerYear;

    @ApiModelProperty(value = "buyTime")
    @NotNull(message="购买日期不能为空")
    private Date buyTime;

    @ApiModelProperty(value = "durationMonth")
    @NotNull(message="期限不能为空")
    @Max(value=120, message="期限不能超过120个月")
    @Min(value=3, message="期限不能小于3个月")
    private Integer durationMonth;
}
